<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>msdate | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>msdate</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>msdate</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/plugins/msdate/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/10-plugins/02-msdate.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
<p>&#x5982;&#x679C;&#x4F60;&#x5728; .NET &#x4E2D;&#x4F7F;&#x7528; OLE Automation &#x65E5;&#x671F;&#xFF0C;&#x5219;&#x67E5;&#x770B; Markit On Demand &#x7684; <code>moment-msdate</code>&#x3002;
&#x4F7F;&#x7528;&#x6B64;&#x63D2;&#x4EF6;&#xFF0C;&#x53EF;&#x4EE5;&#x5C06; OA &#x65E5;&#x671F;&#x683C;&#x5F0F;&#x5316;&#x4E3A; JavaScript &#x65E5;&#x671F;&#xFF0C;&#x53CD;&#x4E4B;&#x4EA6;&#x7136;&#x3002;</p>
<p>&#x5C06; <code>moment</code> &#x8F6C;&#x6362;&#x4E3A; OA &#x65E5;&#x671F;&#xFF1A;</p>
<pre><code class="language-javascript">moment().toOADate(); // &#x6D6E;&#x70B9;&#x6570;
</code></pre>
<p>&#x6216;&#x8005;&#xFF0C;&#x5C06; OA &#x65E5;&#x671F;&#x8F6C;&#x6362;&#x4E3A; <code>moment</code>&#xFF1A;</p>
<pre><code class="language-javascript">moment.fromOADate(41493); // Wed Aug 07 2013 00:00:00 GMT-0600 (MDT)
</code></pre>
<p>&#x66F4;&#x591A;&#x4FE1;&#x606F;&#x548C;&#x8BE6;&#x7EC6;&#x6587;&#x6863;&#x53EF;&#x4EE5;&#x5728; GitHub &#x4E0A;&#x627E;&#x5230; <a href="javascript:window.open('http://nodejs.cn/s/k4632S');" target="_blank" rel="nofollow">http://markitondemand.github.io/moment-msdate/</a>&#x3002;</p>
					</div>
          <div id="content_right">
<p>If you are using OLE Automation dates in .NET check out Markit On Demand&apos;s <code>moment-msdate</code>. Using this plugin allows you to format OA dates into JavaScript dates and vice-versa.</p>
<p>Convert a <code>moment</code> to an OA date:</p>
<pre><code class="language-javascript">moment().toOADate(); // a floating point number
</code></pre>
<p>Or, convert an OA date to a <code>moment</code>:</p>
<pre><code class="language-javascript">moment.fromOADate(41493); // Wed Aug 07 2013 00:00:00 GMT-0600 (MDT)
</code></pre>
<p>More information and detailed docs can be found on GitHub at <a href="javascript:window.open('http://markitondemand.github.io/moment-msdate/');" target="_blank" rel="nofollow">http://markitondemand.github.io/moment-msdate/</a>.</p>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>